<template>
    <div class="mb-4">
        <h2 class="title"><span class="white">练习</span>题</h2>
        <template v-for="work in works">
            <work :key="work.id"  :work="work" @complete="completeWork"></work>
        </template>

    </div>
</template>

<script>
    import Work from './Work';

    export default {
        props: {works: Array},
        components: {Work},
        data() {
            return {complete: {}}
        }, methods: {
            completeWork(result) {
                this.complete[result.id] = result;
                this.$emit('complete', this.complete);
            }
        }
    }
</script>

<style scoped>

</style>